package com.tansun.ruledata.data.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.hibernate.validator.constraints.Length;

import com.tansun.easycare.core.persistence.BaseEntity;

/**
 * 规则数据集Entity
 *
 * @author lxs
 * @version 2017-02-17
 */
public class DeployDataset extends BaseEntity {

    private static final long serialVersionUID = 1L;
    private String projectcode;        // 规则库编码
    private String name;        // 数据集名
    private String chzn;        // 中文名
    private String paramType;        // 类型（输入，输出，输入与输出，仅复用）
    private String dataDesc;        // 描述信息

    private String paramChzn;
    
    private  String  dataVersion;

    private List<String> mFieldNames = new ArrayList<String>();
    private Map<String, DeployDataparams> fieldMap = new HashMap<String, DeployDataparams>();

    public DeployDataset() {
        super();
    }

    public DeployDataset(String id) {
        super(id);
    }

    @Length(min = 0, max = 50, message = "规则库编码长度必须介于 0 和 50 之间")
    public String getProjectcode() {
        return projectcode;
    }

    public void setProjectcode(String projectcode) {
        this.projectcode = projectcode;
    }

    @Length(min = 0, max = 50, message = "数据集名长度必须介于 0 和 50 之间")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Length(min = 0, max = 150, message = "中文名长度必须介于 0 和 150 之间")
    public String getChzn() {
        return chzn;
    }

    public void setChzn(String chzn) {
        this.chzn = chzn;
    }

    @Length(min = 0, max = 10, message = "类型（输入，输出，输入与输出，仅复用）长度必须介于 0 和 10 之间")
    public String getParamType() {
        return paramType;
    }

    public void setParamType(String paramType) {
        this.paramType = paramType;
    }

    @Length(min = 0, max = 100, message = "描述信息长度必须介于 0 和 100 之间")
    public String getDataDesc() {
        return dataDesc;
    }

    public void setDataDesc(String dataDesc) {
        this.dataDesc = dataDesc;
    }

    public List<String> getmFieldNames() {
        return mFieldNames;
    }

    public void setmFieldNames(List<String> mFieldNames) {
        this.mFieldNames = mFieldNames;
    }

    public Map<String, DeployDataparams> getFieldMap() {
        return fieldMap;
    }

    public void setFieldMap(Map<String, DeployDataparams> fieldMap) {
        this.fieldMap = fieldMap;
    }

    public String getParamChzn() {
        return paramChzn;
    }

    public void setParamChzn(String paramChzn) {
        this.paramChzn = paramChzn;
    }
	public String getSql() {
		return "INSERT INTO rule_dataset(id,projectcode,name,chzn,param_type,data_desc,create_date,data_version) values (?,?,?,?,?,?,?,?)";
	}
	public String getExeSql() {
		return "INSERT INTO rule_exe_dataset(id,projectcode,name,chzn,param_type,data_desc,create_date,data_version) values (?,?,?,?,?,?,?,?)";
	}
	
	public Object[] getArgs(String timeStamp) {
		return new Object[] {this.id,this.projectcode,this.name,this.chzn,this.paramType,this.dataDesc,new Date(),timeStamp};
	}

	public String getDataVersion() {
		return dataVersion;
	}

	public void setDataVersion(String dataVersion) {
		this.dataVersion = dataVersion;
	}
	
	
}